import request from '@/utils/request'

// 查询列表
export function listRecycle(query) {
  return request({
    url: '/recycle/list',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getRecycle(recycleId) {
  return request({
    url: '/recycle/' + recycleId,
    method: 'get'
  })
}

// 新增
export function addRecycle(data) {
  return request({
    url: '/recycle',
    method: 'post',
    data: data
  })
}

// 修改
export function updateRecycle(data) {
  return request({
    url: '/recycle',
    method: 'put',
    data: data
  })
}

// 删除
export function delRecycle(recycleId) {
  return request({
    url: '/recycle/' + recycleId,
    method: 'delete'
  })
}

// 完成交易
export function complete(data) {
  return request({
    url: '/recycle/complete',
    method: 'post',
    data
  })
}

// 转问题
export function transferToIssue(data) {
  return request({
    url: '/recycle/transferToIssue',
    method: 'post',
    data
  })
}

// 取消订单
export function cancelTheOrder(data) {
  return request({
    url: '/recycle/cancelTheOrder',
    method: 'post',
    data
  })
}

//查询换绑信息
export function pulsTopicPhone(id) {
  return request({
    url: `/recycle/pulstopicphone/${id}`,
    method: 'get',
  })
}

//输入验证码
export function getValidate(data) {
  return request({
    url: "/recycle/getValidate",
    method: 'post',
    data
  })
}

// 账号估价
export function accountCalcApi(data) {
  return request({
    url: "/business/automatic_shelves/select",
    method: 'get',
    params: data
  })
}

// 获取短信息
export function getMessageApi(data) {
  return request({
    url: "/recycle/getTextMessage",
    method: 'get',
    params: data
  })
}

// 获取手机号频繁
export function changePhoneApi(data) {
  return request({
    url: "/system/record",
    method: 'post',
    data
  })
}

// 获取短信息
export function getRecycleUrlApi(data) {
  return request({
    url: "/system/tRecycleUrl/getUrl",
    method: 'get',
    params: data
  })
}

// 获取手机端上传的图片
export function getPhoneUploadImgApi(id, type) {
  return request({
    url: `/system/app/getImags/${id}/${type}`,
    method: 'get',
  })
}
